window.jQuery == window.$

//find by id
var div = $('#abc');

//find by tag
var ps = $('p');

//find by class
var a = $('.red');
var b = $('.red.green') // class = 'red green'

//find by attribute
var email = $('[name=email]'); //find <??? name="email">
var icons = $('[name^=icon]');//name="icon-1", name="icon-2"
var names = $('[name$=with]');//name="startswith", name="endswith"

var icon = $('[class^="icon-"]'); // class="icon-clock", class="abc icon-home"

//combination
var emailInput = $('input[name=email]');
var tr = $('tr.red');

//multiselect
$('p,div');
$('p.red,p.green');

//<!-- HTML结构 -->
<div class="testing">
    <ul class="lang">
        <li class="lang-javascript">JavaScript</li>
        <li class="lang-python">Python</li>
        <li class="lang-lua">Lua</li>
    </ul>
</div>

//Descendant Selector
$('ul.lang li.lang-javascript'); //[ <li class="lang-javascript">JavaScript</li> ] 
$('div.testing li.lang-javascript');

//Child Selector (must be parents child)
$('ul.lang>li.lang-javascript');
$('div.testing>li.liang-javascript'); //[]

//Filter
$('ul.lang li');
$('ul.lang li:first-child'); // 仅选出JavaScript
$('ul.lang li:last-child'); // 仅选出Lua
$('ul.lang li:nth-child(2)'); // 选出第N个元素，N从1开始
$('ul.lang li:nth-child(even)'); // 选出序号为偶数的元素
$('ul.lang li:nth-child(odd)'); // 选出序号为奇数的元素

<ul class="lang">
    <li class="js dy">JavaScript</li>
    <li class="dy">Python</li>
    <li id="swift">Swift</li>
    <li class="dy">Scheme</li>
    <li name="haskell">Haskell</li>
</ul>

//find
var ul = $('ul.lang'); // 获得<ul>
var dy = ul.find('.dy'); // 获得JavaScript, Python, Scheme
var swf = ul.find('#swift'); // 获得Swift
var hsk = ul.find('[name=haskell]'); // 获得Haskell

var swift = $('#swift');

swift.next(); // Scheme
swift.next('[name=haskell]'); // 空的jQuery对象，因为Swift的下一个元素Scheme不符合条件[name=haskell]

swift.prev(); // Python
swift.prev('.dy'); // Python，因为Python同时符合过滤器条件.dy

//filter()
var langs = $('ul.lang li'); // 拿到JavaScript, Python, Swift, Scheme和Haskell
langs.filter(function () {
    return this.innerHTML.indexOf('S') === 0; // 返回S开头的节点
}); // 拿到Swift, Scheme

//map()
var langs = $('ul.lang li'); // 拿到JavaScript, Python, Swift, Scheme和Haskell
var arr = langs.map(function () {
    return this.innerHTML;
}).get();